//
//  BKMainCommon.h
//  bestkeep
//
//  Created by 武探 on 2016/11/3.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MJRefresh.h>
#import "Masonry.h"
#import "BKFirstPageModel.h"
#import <UIImageView+WebCache.h>
#import "SDCycleScrollView/SDCycleScrollView.h"
#import "Common.h"
#import "BKFirstPageDataModel.h"
#import "BKMain_StrikeLabel.h"
#import "Mediator+BKGD.h"
#import "Mediator+BKMy.h"
#import "Mediator+BKClassify.h"
#import "BKPhoneCardsModel.h"
#import "BKMain_GoodsTitleCell.h"
#import "BKMain_CycleScrollViewCell.h"
#import "BKMain_ActiveCell.h"
#import "BKMain_RecommendCell.h"
#import "BKMain_SimplePicCell.h"
#import "BKMain_ClassifyTitleCell.h"
#import "BKMain_TitleCell.h"
#import "BKMain_RecommendAndClassifyCell.h"
#import "RootNavigationController.h"


#import "BKMainViewController.h"
#import "HUD.h"
#import "ExceptionView.h"
#import "Resources.h"
#import "RequestManager+BK.h"
#import "CacheImage.h"
#import "CacheData.h"
#import "BKIntegralCommon.h"
#import <MJRefreshGifHeader.h>
#import "PromptTools.h"
#import "BKMain_WebViewController.h"
#define BKMainLocalizedString(key) [BKMainCommon localizedStringWithKey:key]
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define RGB(__r, __g, __b)  [UIColor colorWithRed:(1.0*(__r)/255)\
green:(1.0*(__g)/255)\
blue:(1.0*(__b)/255)\
alpha:1.0]
#define IF(A,B,C)  if (A) {B;}else{C;}
/** 设备是否为iPhone 4/4S 分辨率320x480，像素640x960，@2x */
#define iPhone4s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)

/** 设备是否为iPhone 5C/5/5S 分辨率320x568，像素640x1136，@2x */
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

/** 设备是否为iPhone 6 分辨率375x667，像素750x1334，@2x */
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)

/** 设备是否为iPhone 6 Plus 分辨率414x736，像素1242x2208，@3x */
#define iPhone6P ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)
#define IPHONE_HEIGHT CGRectGetHeight([UIScreen mainScreen].bounds)
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]



#define HotTitle @"hot"
#define NewerTitle @"new"

#define kSelectColor RGBACOLOR(0, 186, 156, 1)
#define kUnselectColor RGBACOLOR(153, 153, 153, 1)


@interface BKMainCommon : NSObject
typedef void (^CompeletionCallBack)(id obj,NSError *error);

+(NSString*)localizedStringWithKey:(NSString*)key;
+(NSMutableAttributedString *)specialStringStyle:(NSString*)string fontOfSize:(CGFloat)fontOfSize;
+(NSMutableAttributedString *)specialStringStyle:(NSString*)string fontOfSize:(CGFloat)fontOfSize originalPrice:(NSString*)originalPrice;
//判断用户登录状态
+(BOOL)islogin;
//判断网络
+(BOOL)checkNetWork;
//得到用户id
+(NSString *)getUserId;
//获取ST
+(NSString *)getUserST;
+ (NSString *)ServicesURL:(NSString *)url;
//首页数据请求
+(void)getNewFirstPageData:(CompeletionCallBack)callback;
+(CGSize)sizeWithContentString:(NSString *)content textFont:(UIFont *)font size:(CGSize)contentSize;
//精选数据请求
+(void)getFeaturedData:(NSString *)page size:(NSString *)size callback:(CompeletionCallBack)callback;
//获取手机充值页面banner数据
+(void)getBKPhoneCardsBannerData:(CompeletionCallBack)callBack;
//获取手机话费充值货架信息
+(void)getPhoneSelectInfo:(CompeletionCallBack)callback account_no:(NSString *)account_no;
//获取手机流量货架信息
+(void)getPhoneFlowInfo:(CompeletionCallBack)callback account_no:(NSString *)account_no;
//获取手机充值记录
+(void)getPhoneCardsRecord:(NSString *)currentPage myCallback:(CompeletionCallBack)callback;

//accountNo	string	是	手机号
//chargeType	string	是	充值类型：1话费；2流量
//facePrice	string	是	充值面额
//salePrice	string	是	售价金额
+ (void)phonePayOrder:(NSMutableDictionary *)body_dic callback:(CompeletionCallBack)callback;

//根据订单编号查询充值订单支付信息
+ (void)getPhonePayOrderAlipayInfoWithOrderNo:(NSString *)orderNo callback:(CompeletionCallBack)callback;
//获取用户是否APP评价
+(void)getAPPStoreEvaluateCallBack:(CompeletionCallBack)callback;
+(void)setFirstLineTextIndentWithContent:(UILabel*)contentLabel firstLineHeadIndent:(CGFloat)value;
+(void)goodsDetailAnimationWithFrame:(CGRect)frame goodsId:(NSString*)goodsId saleTypes:(id)saleTypes goodsCoverImg:(NSString*)goodsCoverImg  ViewController:(UIViewController*)pushVC;
@end
